<link rel="stylesheet" href="./vanui.css">
<div id="app">
    <h1>首页</h1>
    <van-nav-bar title='首页' @click-left='fatherClickLeftFn' @click-right='fatherClickRightFn'></van-nav-bar>

    <van-button title='创建' type='bule' @click='fatherClickFn'></van-button>
    <van-button title='修改' type='green' @click='fatherClickFn'></van-button>

    <van-loading :show='flag'></van-loading>

    <van-tips title='你有瑕疵' :show='flag'></van-tips>

    <van-table :columns='columns1' :data='data1'></van-table>

</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="./lx.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            columns1: [
                { title: '编号2', key: 'id' },
                { title: '姓名2', key: 'name' },
                { title: '年龄2', key: 'age' },
                { title: '年龄2', key: 'age' },
                { title: '年龄2', key: 'age' },
            ],
            data1: [
                { id: 1, name: '大树', age: 7 },
                { id: 2, name: '大树君', age: 77 },
                { id: 3, name: '大树参天', age: 777 },
                { id: 4, name: '一颗大树参天', age: 7777 },
            ],
            flag: true
        },
        methods: {
            fatherClickLeftFn() {
                console.log('返回');
            },
            fatherClickRightFn() {
                console.log('搜索');
            },
            fatherClickFn() {
                console.log('按钮');
                if(this.flag){
                    this.flag = false
                }else{
                    this.flag = true
                }
            }
        }
    })
</script>